import { lazy } from "react";
import { createBrowserRouter } from 'react-router-dom'

let Mainlayout = lazy(()=>import('../paget/mainlayout/Index'))
let Error = lazy(()=>import('../paget/mainlayout/Index'))

let Home = lazy(()=>import('../paget/home/Index'))
let Porps = lazy(()=>import('../paget/porps/Index'))
let Message = lazy(()=>import('../paget/message/Index'))
let User = lazy(()=>import('../paget/user/Index'))

export const homeroute = [
    {
        path:'/',
        element:<Home></Home>,
        title:'首页',

    },
    {
        path:'/porps',
        element:<Porps></Porps>,
        title:'分类',

    },
    {
        path:'/message',
        element:<Message></Message>,
        title:'消息',

    },
    {
        path:'/user',
        element:<User></User>,
        title:'我的',

    },
]

export const route = createBrowserRouter([
    {
        path:'/',
        element:<Mainlayout></Mainlayout>,
        children:homeroute
    },
    {
        path:'*',
        element:<Error></Error>
    },
])